/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package exatrez.model;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import org.hibernate.type.ClobType;

/**
 *
 * @author Mansur
 */
@Entity
@Table(name = "sv_desc")
@NamedQueries({
    @NamedQuery(name = "ShipVisitDescription.findAll", query = "SELECT v FROM ShipVisitDescription v")})
public class ShipVisitDescription implements Serializable{
    private static final long serialVersionUID = 1L;
    @Id
//    @GeneratedValue(strategy = GenerationType.IDENTITY)
//    @Basic(optional = false)
    @Column(name = "sv_desc_id")
    private String svDescId;
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "sv_header_id")
    private ShipVisitHeader svHeaderId;
    @Column(name = "description")
    private String description;
    @Column(name = "sortNum")
    private Integer sortNumber;
    
    @Embedded
    private InfoAudit infoAudit;
    
    public ShipVisitDescription(){
        
    }

    public String getSvDescId() {
        return svDescId;
    }

    public void setSvDescId(String svDescId) {
        this.svDescId = svDescId;
    }

    public ShipVisitHeader getSvHeaderId() {
        return svHeaderId;
    }

    public void setSvHeaderId(ShipVisitHeader svHeaderId) {
        this.svHeaderId = svHeaderId;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Integer getSortNumber() {
        return sortNumber;
    }

    public void setSortNumber(Integer sortNumber) {
        this.sortNumber = sortNumber;
    }

    public InfoAudit getInfoAudit() {
        return infoAudit;
    }

    public void setInfoAudit(InfoAudit infoAudit) {
        this.infoAudit = infoAudit;
    }
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (svDescId != null ? svDescId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof ShipVisitDescription)) {
            return false;
        }
        ShipVisitDescription other = (ShipVisitDescription) object;
        if ((this.svDescId == null && other.svDescId != null) || (this.svDescId != null && !this.svDescId.equals(other.svDescId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "exatrez.model.ShipVisitDescription[ svDescId=" + svDescId + " ]";
    }
}
